export default {
    init: function() {
      const AK = '63964a35726c4289930a401014d6b2dd'
      const TMapURL = 'http://api.tianditu.gov.cn/api?v=4.0&tk=' + AK
      return new Promise((resolve, reject) => {
		  if( typeof T !== undefined){
			  console.log("地图初始化成功1111")
			  resolve(T)
			  return true
		  }
        window.onload = function() {
          console.log('地图脚本初始化成功...')
          resolve(T)
        }
   
        // 插入script脚本
        const scriptNode = document.createElement('script')
        scriptNode.setAttribute('type', 'text/javascript')
        scriptNode.setAttribute('src', TMapURL)
        document.body.appendChild(scriptNode)
      })
    }
}
